﻿using Direct.IDAL.User.Bonus;
using DirectSell.Common.Filter;
using DirectSell.Common.Page;
using DirectSell.Common.Session;
using DirectSell.Common.Url;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace DirectSell.WebLayer.Areas.User.Controllers
{
    /// <summary>
    /// 奖金查看
    /// </summary>
    public class BonusController : Controller
    {
        #region 注入
        [Dependency]
        protected IBonusRepository _repository { get; set; }
        #endregion

        #region 详情列表
        /// <summary>
        /// 详情列表
        /// </summary>
        /// <returns></returns>
        [LoginFilter(IsCheck =true)]
        public async Task<ActionResult> Detail(int page = 1)
        {
            var sessioninfo = SessionInfo.GetSession();

            var model =  await _repository.QueryBonusList(sessioninfo.UserId,page, CommonConfig.PageSize);

            return View(model);
        }
        #endregion
    }
}